/*This file is part of AENIMA. AENIMA is a module of BCI++ framework for the implementation of brain computerinterface systems. 
AEnima is intended for use with BCI++ only.

BCI++ is a project of the Sensibilab of the Politecnico di Milano. 

AENIMA is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation, either version 3 of 
the License, or (at your option) any later version.

AENIMA is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
and the GNU Lesser General Public License along with AENIMA.  
If not, see <http://www.gnu.org/licenses/>.*/

/*!
	\file	DealProtType.h
	 This file contains DealProtType class. This class allow to create dynamic library and exchange data with
	 the main program.

	\author	Sensibilab EMail: info.sensibilab@polimi.it

	\date	2007-09-06 creation \n
		2009-01-27 last modification

	\b COPYRIGHT: 
		This program is property of Sensibilab - Campus Ponit - Lecco
*/
#pragma once

//#include "SocketComm.h"
//#include "Led\LedDriver.h"
//#include "SoundSystem.h"
//#include "GraphicEngine.h"

#include "SocketComm_base.h"
#include "LedDriver_base.h"
#include "SoundSystem_base.h"
#include "GraphicEngine_base.h"

#include "structs\BCIMessage.h"
#include "ProtocolMngr.h"


class ProtocolMngr;
/*!\class DealProtType
Class for protocols management. See AEnima documentation and dealProtocol for more details.*/
class DealProtType
{
public:
	DealProtType(GraphicEngine_base* , SoundSystem_base*, SocketComm_base*, LedDriver_base*);
	virtual ~DealProtType(void);
	virtual void changeProtocol(char *name, bool startup);
	virtual bool runProtocol(char *name,bool startup);
	virtual void EvalProt(void);
	virtual bool StartProt(void);
	virtual bool StopProt(void);
	virtual void OnProtocolEvent(void);
	virtual void OnSocketEvent(BCIMessage *SocketMsg);
public:
	/*GraphicEngine *AEngine;
	SoundSystem *MainAudio;
	SocketComm*	MainSocket;
	LedDriver *Stimuli;*/
	GraphicEngine_base *AEngine;
	SoundSystem_base *MainAudio;
	SocketComm_base*	MainSocket;
	LedDriver_base *Stimuli;
	bool		isLoading;
protected:
	BCIMessage TempMessage;
	char		NextProt[256];
	bool		resEngine;
	
};
